import { querystring, isDef } from '@jiess/utils';
import RequestParse from './RequestParse/index.js';
import tableBase from './table-base.js';
import tableTabs from './table-tabs.js';
const { VITE_CONFIG_BASE } = import.meta.env;
export default async (...args) => {
	return await new RequestParse(...args)
		.build(function(init) {
			// 验证码
			init('/captcha', (dd) => {
				return {
					text: 'Jiess',
					data: VITE_CONFIG_BASE + '/images/common/yan.svg'
				}
			});
			// 用户登录
			init('/login', (dd) => {
				return {
					accessToken: 'Jiess-token',
					// ------------------------
					accountId: 666,
					name: '熏悟空',
					phone: 13600000000,
					resourceList: [{
						id: 740,
						parentId: 790,
						name: 'home',
						viewKey: 'home'
					}]
				}
			});
			// 列表数据
			tableBase.call(this, init);
			tableTabs.call(this, init);
		});
}